﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;
using Ashlen.Portal.Core;
using Ashlen.Portal.Core.DTO;
using Ashlen.Portal.Core.DataInterfaces;
using Ashlen.Portal.Data;
using Ashlen.Portal.Services.BindingExtensions;

namespace Ashlen.Portal.Services
{
    [ServiceContract]
    public interface IWidgetService
    {
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string LoadWidgets();

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")] 
        string CreateWidget(string name, string url, string desc, int version, string author, bool isDefault,
                                string body, string defaultState, string icon, int orderNo, string userCreated);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")] 
        string SelectWidget(Guid? id, string name);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string CreatePage(string title, string username, int layoutType);


        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")] 
        string SelectPage(string title, string username);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")] 
        string SelectPages(string username);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string SelectWidgets(string pageId);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string DeletePage(string pageId);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string EditPage(string pageId, string title, string username, string layoutId);
    }
}
